<template>
  <el-switch
    v-model="switchValue"
    style="display:block;margin-top:15px"
    :width="50"
    :disabled="disabled"
    active-color="#13ce66"
    :active-text="prop"
    @change="change"
  />
</template>
<script>
export default {
  name: 'ExportColumnSwitch',
  props: {
    prop: {
      type: String,
      required: true
    },
    value: {
      type: Boolean,
      required: true
    },
    disabled: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {
      switchValue: this.value
    }
  },
  watch: {
    value(val) {
      this.switchValue = val
    }
  },
  methods: {
    change(val) {
      this.$emit('input', val)
    }
  }
}
</script>

<style scoped>

</style>
